package com.societyGames.robotsExercises
{
import com.societyGames.codeExercise.CodeExercise;

public class RobotsCodeExercise extends CodeExercise
{
  public var simulation:RobotsSimulation;

  public override function initialize():void
  {
    //Create the simulation
    this.simulation.initialize(this._actionQueue);
    this.addChild(this.simulation.render);
  }

  protected override function evaluateWithExceptionsHandled():void
  {
    if (this.simulation.areRobotsHome())
    {
      reportSuccess();
    }
    else
    {
      reportFailure();
    }
  }
}
}